]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
shell: Do not create a systemd scope when using D-Bus app launching
authormsizanoen1 <msizanoen@qtmlabs.xyz>
Thu, 26 May 2022 06:15:06 +0000 (13:15 +0700)
committerMarge Bot <marge-bot@gnome.org>
Tue, 7 Jun 2022 14:35:02 +0000 (14:35 +0000)
Applications launched using D-Bus activation will have a returned PID of
0, which systemd interprets as moving the requesting process to a new
scope, causing GNOME Shell to be moved to another scope. Fix this by not
creating a systemd scope when PID is 0.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2305>

src/shell-global.c

index efe1271b5a143c7eb7a1b3d29edce051087ffc9a..60f078f3b965f9a8feeb8ea28b4e4763cf452221 100644 (file)
@@ -1399,6 +1399,11 @@ shell_global_app_launched_cb (GAppLaunchContext *context,
   if (!g_variant_lookup (platform_data, "pid", "i", &pid))
     return;
 
+  /* If pid == 0 the application was launched through D-Bus
+   * activation, therefore it's already in its own unit */
+  if (pid == 0)
+    return;
+
   app_name = g_app_info_get_id (info);
   if (app_name == NULL)
     app_name = g_app_info_get_executable (info);